package com.zzptc.my;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class RegActivity extends AppCompatActivity {

Button btn_cz1;
Button btn_zc1;

EditText et_zh1;
EditText et_mm1;
    EditText et_mm2;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_reg);
        init();
event();

    }
    public void init(){

        btn_cz1=findViewById(R.id.btn_cz1);
        btn_zc1=findViewById(R.id.btn_zc1_ok);
        et_mm1=findViewById(R.id.etmm1);
        et_mm2=findViewById(R.id.etmm2);
        et_zh1=findViewById(R.id.etzh1);

    }
    public void event(){
btn_zc1.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        String unername=et_zh1.getText().toString().trim();
        Toast.makeText(RegActivity.this, unername+"您好", Toast.LENGTH_SHORT).show();
        Intent intent=new Intent();
        intent.putExtra("name",unername);
        setResult(2,intent);
        finish();
    }
});
    }
}
